package main

import (
	"github.com/lifei6671/mredis/mredis"
	"log"
	"fmt"
	"time"
)

func main() {
	client,err := mredis.NewRedisClient("127.0.0.1",6379,10,"")

	if err != nil{
		log.Fatalf("建立对象失败：%s",err)
	}
	command,err := client.Command()
	if err != nil{
		log.Fatalf("获取命令对象失败:%s",err)
	}

	 command.Select(1)

	s,err := command.PexpireAt("123",time.Now().Add(time.Second * 3600 * 24))
	if err != nil{
		log.Fatalf("获取命令对象失败:%s",err)
	}
	fmt.Println(s)
	err = command.Rename("123","1234")
	if err != nil{
		log.Fatalf("PTTL:%s",err)
	}

	//fmt.Printf("RandomKey %s",t)
}
